package com.cefa.edu.service;

import com.cefa.edu.dao.UserMapper;
import com.cefa.edu.dao.UserRoleMapper;
import com.cefa.edu.model.Role;
import com.cefa.edu.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author huangzehui
 * @date 18-7-29 上午10:56
 */
@Service
public class LoginService {
    @Autowired
    UserMapper userMapper;

    @Autowired
    UserRoleMapper userRoleMapper;

    public int getUserByUserName(String userName){
        return  userRoleMapper.getUserByUserName(userName);
    }
    public List<User> getUserRole(Integer id, String order){
        return  userMapper.getUserRole(id,order);
    }
    public List<User>  getUser(String password,String name) {
        return userMapper.getUser(password,name);
    }

    public Role getRoleByType(int roleType) {
        return userMapper.getRoleByType(roleType);
    }
    public User getUserByIdCode(String idCode) {
        return userMapper.getUserByIdCode(idCode);
    }

    public User getUserByLevelIdAndIdCode(Integer levelId,String idCode) {
        return userMapper.getUserByLevelIdAndIdCode(levelId,idCode);
    }
}
